@extends('default.mobile.layouts.personalPublic')
@section('title','教育经历-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
@endsection
{{--头部标签--}}
@section('tag','教育经历')
@section('link') href="{{url('mobile/personal/resume_manage?parameter=education&resume_id='.$resumeEducationExp->resume_id)}}" @endsection

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="{{url('mobile/personal/edit_edu_exp')}}"  onsubmit="return checkEdu('#eduForm')"  method="post" id="eduForm" name="eduForm">
                {{csrf_field()}}
                <input type="hidden" name="resume_id" id="resume_id"  value="{{$resumeEducationExp->resume_id}}">
                <input type="hidden" name="id" id="id"  value="{{$resumeEducationExp->id}}">
                <input type="hidden" name="edu_type" id="edu_type"  value="1">
                <dl>
                    <dt>学校名称<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="school" id="school"  value="{{$resumeEducationExp->school}}" placeholder="请输入学校名称" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="education_select">
                    <input type="hidden" name="education" value="{{$resumeEducationExp->education}}" id="education" />
                    <dt>最高学历<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择最高学历</span></dd>
                </dl>
                <dl>
                    <dt>是否统招</dt>
                    <dd>
                        <span class="radio"><input name="type" checked id="type2" value="0" type="radio"><label for="type2">否</label></span>
                        <span class="radio"><input name="type"  id="type1" value="1" type="radio"><label for="type1">是</label></span>
                    </dd>
                </dl>
                <dl class="arrow" id="starttime_select">
                    <input type="hidden" name="starttime" value="{{$resumeEducationExp->starttime}}" id="starttime" />
                    <dt>开始时间<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择开始时间</span></dd>
                </dl>
                <dl class="arrow" id="endtime_select">
                    <input type="hidden" name="endtime" value="{{$resumeEducationExp->endtime}}" id="endtime" />
                    <dt>结束时间<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择结束时间</span></dd>
                </dl>
                <dl>
                    <dt>专业名称<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="speciality" id="speciality" value="{{$resumeEducationExp->speciality}}" placeholder="请输入专业名称" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="edu_description">
                    <dt>教育描述</dt>
                    <dd>
                        <textarea name="description" id="description" style="display: none;">{{$resumeEducationExp->description}}</textarea>
                        <span class="select_text">@if(empty($resumeEducationExp->description))请输入教育描述@else{{$resumeEducationExp->description}}@endif</span>
                    </dd>
                </dl>
                <div class="form_sub"><input type="submit" value="保存"></div>
            </form>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_time.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.textarea.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/zepto.scroll.js')}}"></script>

    <script>
        $(function(){
            var fill = $("#fill").find('#form_info');
            //公司性质
            fill.find("#education_select").select({
                select_title:'公司性质',                //标题值
                hidden: '#education',                   //select隐藏表单值
                opt_data:option_education               //select选项值（数组json对象）
            });
            //开始时间
            fill.find("#starttime_select").select_time({
                select_title:'开始时间',
                hidden: '#starttime',
                select_con:'#select_start'
                //toDate:true
            });
            //结束时间
            fill.find("#endtime_select").select_time({
                select_title:'结束时间',
                hidden: '#endtime',
                select_con:'#select_end',
                toDate:true
            });
            //点击教育描述
            fill.find("#edu_description").textarea({
                text_title:'教育描述',
                hidden: '#description'
            });
            //是否统招
            var type =  '{{$resumeEducationExp->type}}';
            if(type == 1){
                fill.find('#type1').attr('checked',true);
            }else{
                fill.find('#type2').attr('checked',true);
            }
        });
        //错误信息提示
        @if(count($errors)>0)
            @if(is_object($errors))
                var msgErr='';
                @foreach($errors->all() as $error)
                        msgErr += "<p style='line-height: .4rem; width: 100%'>{{$error}};</p>";
                @endforeach
                layerMsg(msgErr,2);
            @endif
        @endif
    </script>
@endsection